#alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
# Simon Castillo <simoncastillo@gmail.com>
# September 25, 2006 (Monday, 20:29h) 
# User prompt shamelessly ripped of from Eike Hein's configs.

eval `dircolors -b ~/.dircolors`

### Bash options
shopt -s checkwinsize
shopt -s no_empty_cmd_completion
shopt -s dotglob
shopt -s cdspell
shopt -s extglob
shopt -s cmdhist
shopt -s promptvars
shopt -s cmdhist
shopt -s no_empty_cmd_completion
set -o noclobber

if isatty; then
    stty -ixon
    stty -ixoff
fi

if [ "$TERM" = "linux" ]; then
    echo -en "\e]P0222222" #black
    echo -en "\e]P8222222" #darkgrey
    echo -en "\e]P1803232" #darkred
    echo -en "\e]P9982b2b" #red
    echo -en "\e]P25b762f" #darkgreen
    echo -en "\e]PA89b83f" #green
    echo -en "\e]P3aa9943" #brown
    echo -en "\e]PBefef60" #yellow
    echo -en "\e]P4324c80" #darkblue
    echo -en "\e]PC2b4f98" #blue
    echo -en "\e]P5706c9a" #darkmagenta
    echo -en "\e]PD826ab1" #magenta
    echo -en "\e]P692b19e" #darkcyan
    echo -en "\e]PEa1cdcd" #cyan
    echo -en "\e]P7ffffff" #lightgrey
    echo -en "\e]PFdedede" #white

     #this is an attempt at working utf8 line drawing chars in the linux-console
#    export TERM=linux+utf8
    clear #hmm, yeah we need this or else we get funky background collisions
fi

### Aliases
alias ls='ls --color=auto -hF'
alias top="htop"
alias firefox="aoss firefox"
alias cp="cp -ri"
alias rm="rm -i"
alias mv="mv -i"
alias pg="ps aux | grep" # requires an argument
alias c="clear"
alias svim="sudo vim"
alias vi="vim"

### Exports
export GTK2_RC_FILES=$HOME/.gtkrc-2.0
export PATH=$PATH:/usr/local/bin:/home/simon/bin:/home/simon/lamp-1.2.1:/home/simon/django_src/django/bin
export EDITOR="vim"
export VISUAL=$EDITOR
export HISTCONTROL=ignoredups
export PYTHONPATH=$PYTHONPATH:/home/simon/django_src:/home/simon/django_projects
export HISTIGNORE="&:[bf]g:exit"
export HISTFILESIZE=10000
export HISTFILE=10000
export PAGER=most
export MANPAGER=most
export MAIL=~/.mail
export IGNOREEOF=3
### Prompt
#BGREEN='\[\033[1;32m\]'
#GREEN='\[\033[0;32m\]'
#BRED='\[\033[1;31m\]'
#RED='\[\033[0;31m\]'
#BBLUE='\[\033[1;34m\]'
#BLUE='\[\033[0;34m\]'
#NORMAL='\[\033[00m\]'

#if [[ `whoami` = 'root' ]]; then
#    export PS1="\[\033[00m\033[01;31m\]\h \[\033[01;34m\]$PROMPT_DIRSTRING \\\$ \[\033[00m\]"
#    export PS1="${BRED} \h"
#else
#    # export PS1="[$BGREEN\u@\h\[\e[0m\] $BRED\w\[\e[0m\]$BLUE $(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')\[\e[0m\]]\\$ "
#    export PS1="[${BGREEN}\u@\h\[\e[0m\] ${RED}\w\[\e[0m\] ${BLUE}\$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')\[\e[0m\]]\\$ "
#fi

x () {
	if [ -f $1 ] ; then
		case $1 in
			*.tar.bz2)	tar xjf $1		;;
			*.tar.gz)	tar xzf $1		;;
			*.bz2)		bunzip2 $1		;;
			*.rar)		unrar x $1  	;;
			*.gz)		gunzip $1		;;
			*.tar)		tar xf $1		;;
			*.tbz2)		tar xjf $1		;;
			*.tgz)		tar xzf $1		;;
			*.zip)		unzip $1		;;
			*.Z)		uncompress $1	;;
			*)			echo "'$1' cannot be extracted via extract()" ;;
		esac
	else
		echo "'$1' is not a valid file"
	fi
}  

function mktar() { tar czf "${1%%/}.tar.gz" "${1%%/}/"; }
function mkmine() { sudo chown -R ${USER} ${1:-.}; }
function calc() { echo "$*" | bc; }

### Load
# uncomment this line to get an ascii welcome message when you open up bash

PS1="\[\033[36m\]\u\[\033[37m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]$ "
echo -e "\e[0;36m              _                                   _     _ _                 
          _=(SDGJT=_                             | |   | (_)                 
        _GTDJHGGFCVS)                _ _ _ __ ___| |__ | |_ _ __  _   ___  __
       ,GTDJGGDTDFBGX0             / _\` | '__/ __| '_ \| | | '_ \| | | \ \/ /
      JDJDIJHRORVFSBSVL\e[0;37m-=+=,_\e[0;36m     | (_| | | | (__| | | | | | | | | |_| |>  <
     IJFDUFHJNXIXCDXDSV,\e[0;37m  \"DEBL\e[0;36m    \__,_|_|  \___|_| |_|_|_|_| |_|\__,_/_/\_\ 
    |LKDSDJTDU=OUSCSBFLD.\e[0;37m   '?ZWX,\e[0;36m
    LMDSDSWH='   \`?DCBOSI\e[0;37m     DRDS],   $(cat /etc/arch-release)\e[0;36m
   SDDFDFH'        \`0YEWD,\e[0;37m    )HDROD   $(uname -o) $(uname -r -m)\e[0;36m
  !KMDOCG            &GSU|\e[0;37m_GFHRGO'\e[0;36m
  HKLSGP'           \e[0;37m__\e[0;36mTKM0\e[0;37mGHRBV)'\e[0;36m
 JSNRVW'       \e[0;37m__+MNAEC\e[0;36mIOI,\e[0;37mBN'\e[0;36m
 HELK['  \e[0;37m  __,=OFFXCBGHC\e[0;36mFD)
JKGHEH\e[0;37m_-#DASDFSLSV='\e[0;36m    'EF
!EHTI    \e[0;36m                !H
 \`0F'                    '!\e[0m"

